<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title></title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
        content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
</head>

<body layadmin-themealias="default">

    <div class="layui-fluid">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md12">
                <div class="layui-card">
                    <div class="layui-card-body" pad15="">
                        <div class="layui-form" wid100="" lay-filter="">
                            <input type="hidden" name="id" value="{$ret['id']}">
                            <div class="layui-form-item">
                                <label class="layui-form-label">奖励物品</label>
                                <div class="layui-input-inline" style="width:350px;">
                                    <input type="text" name="name" value="{$ret['name']}" placeholder="请输入奖励物品名称"
                                        class="layui-input" lay-verify="required" maxlength="255">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">物品数量</label>
                                <div class="layui-input-inline" style="width:350px;">
                                    <input type="text" name="quantity" value="{$ret['quantity']}"
                                        placeholder="请输入奖励物品数量" class="layui-input" lay-verify="required"
                                        maxlength="255">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">步数关卡</label>
                                <div class="layui-input-inline" style="width:350px;">
                                    <input type="text" name="stage" value="{$ret['stage']}" placeholder=""
                                        class="layui-input" lay-verify="required" maxlength="255">
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <label class="layui-form-label">奖励类型</label>
                                <div class="layui-input-inline">
                                    <select name="type" lay-filter="type" id="type" lay-verify="required">
                                        <option value=""></option>
                                        <option value="1" <?php echo $ret['type']==1 ? 'selected' : '' ?> >虚拟</option>
                                        <option value="2" <?php echo $ret['type']==2 ? 'selected' : '' ?> >实物</option>
                                        <option value="3" <?php echo $ret['type']==3 ? 'selected' : '' ?> >奖励机会</option>
                                        <option value="5" <?php echo $ret['type']==5 ? 'selected' : '' ?> >龙钻</option>
                                        <option value="6" <?php echo $ret['type']==6 ? 'selected' : '' ?> >金币</option>
                                        <option value="7" <?php echo $ret['type']==7 ? 'selected' : '' ?> >经验值</option>
                                        <option value="105" <?php echo $ret['type']==105 ? 'selected' : '' ?> >观赛券</option>
                                    </select>
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <label class="layui-form-label">物品等级</label>
                                <div class="layui-input-inline">
                                    <select name="rank" lay-filter="rank" id="rank" lay-verify="required">
                                        <option value=""></option>
                                        <option <?php echo $ret['rank']==1 ? 'selected' : '' ?> value="1">1</option>
                                        <option <?php echo $ret['rank']==2 ? 'selected' : '' ?> value="2">2</option>
                                        <option <?php echo $ret['rank']==3 ? 'selected' : '' ?> value="3">3</option>
                                        <option <?php echo $ret['rank']==4 ? 'selected' : '' ?> value="4">4</option>
                                        <option <?php echo $ret['rank']==5 ? 'selected' : '' ?> value="5">5</option>
                                    </select>
                                </div>
                            </div>

                            <div class="layui-form-item" id="img1">
                                <label class="layui-form-label">奖品图片</label>
                                <div class="layui-input-inline" style="width: 400px">
                                    <input name="thumb" lay-verify="required" id="LAY_iconImgSrc" placeholder=""
                                        value="{$ret['thumb']}" class="layui-input" />
                                </div>
                                <div class="layui-input-inline layui-btn-container" style="width: auto">
                                    <button type="button" class="layui-btn layui-btn-primary" id="LAY_iconImgUpload">
                                        <i class="layui-icon">&#xe67c;</i>上传图片
                                    </button>
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <div class="layui-input-block">
                                    <button class="layui-btn" lay-submit="" lay-filter="save">确认保存</button>
                                </div>
                            </div>
                        </div>

                    </div>
                </div>
            </div>
        </div>
    </div>

    <script src="/layuiadmin/layui/layui.js"></script>
    <script src="/assets/cos-js-sdk-v5/cos-js-sdk-v5.min.js"></script>
    <script src="/assets/ue/third-party/jquery-1.10.2.js"></script>
    <script>

        var laytpl = null;
        var form = null;

        layui.config({
            base: '/layuiadmin/' //静态资源所在路径
            , version: "{:config('other.ui_version')}"
        }).extend({
            index: 'lib/index' //主入口模块
        }).use(["index", "signin", "laytpl", "admin", "element"], function () {
            var $ = layui.$
                , admin = layui.admin;

            laytpl = layui.laytpl;
            form = layui.form;

            // 付费选择
            form.on("submit(save)", function (obj) {
                //提交
                layer.load();
                admin.req({
                    url: "/admin/signin/edit_handle",
                    data: obj.field,
                    success: function (res) {
                        layer.closeAll("loading");
                        if (res.code == 0) {
                            layer.msg(res.msg, { icon: 1 });
                            setTimeout(function () {
                                window.location.reload();
                                parent.location.reload();
                            }, 1200);
                        }
                    },
                    complete: function () {
                        layer.closeAll("loading");
                    },
                });
                return false;
            });
        });


    </script>
</body>

</html>